package org.yxt.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yxt.springcloud.entities.CommonResult;

@RestController
@RequestMapping(value = "config")
@RefreshScope//注入RefreshScope开启动态配置刷新
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping(value = "info")
    public CommonResult info() {
        return new CommonResult(1, "success", configInfo);
    }
}
